import App from './App'
import Vue from 'vue'
import store from '@/store'

import MyNavbar from '@/components/my-navbar/my-navbar'
import MyPopup from '@/components/my-popup/my-popup'
import StatusBar from '@/components/status-bar'
import SafeArea from '@/components/safe-area'

import api from '@/common/api.js'
import util from '@/common/util.js'

import "./project/useTheme.js"
Vue.prototype.$api = api
Vue.prototype.$showToast = util.showToast

Vue.config.productionTip = false
App.mpType = 'app'

Vue.component('status-bar', StatusBar)
Vue.component('my-navbar', MyNavbar)
Vue.component('safe-area', SafeArea)
Vue.component('my-popup', MyPopup)

Vue.mixin({
	onLoad(options = {}) {
		for (let i in options) {
			if (options[i] === 'undefined' || options[i] === 'null') delete options[i];
		}
	}
})

const app = new Vue({
	...App,
	store
})

app.$mount()
